package com.hnkywl.sts.action.flow.endState;

import com.hnkywl.sts.util.ApplicationInstance;
import com.hnkywl.sts.entity.htgl.Cght;
import com.hnkywl.sts.service.htgl.CghtService;
import org.jbpm.api.listener.EventListener;
import org.jbpm.api.listener.EventListenerExecution;

/**
 * Created with IntelliJ IDEA.
 * User: jerry
 * Date: 13-4-29
 * Time: 下午3:13
 * To change this template use File | Settings | File Templates.
 */
public class EndCghtState implements EventListener {

    @Override
    public void notify(EventListenerExecution execution) throws Exception {
        // 改变状态  ytj--->ysp
        CghtService cghtService = ApplicationInstance.createCghtService();
        Cght cght = cghtService.findCghtDetailByProcessInstance(execution.getProcessInstance().getId());
        cght.setZt("ysp");
//        if (cght.getCglx().equals("zddh")&&cght.getZddhxsht()!=null) {
//            cght.getZddhxsht().setZt("ysp");
//        }
        cghtService.editCght(cght, cght.getHtbm());
    }
}
